import Vue from 'vue'
import App from './App.vue';
import router from './router'
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import ViewUI from 'view-design';


import 'view-design/dist/styles/iview.css';
//
// import {Button,Table,Row,Col,Card,ButtonGroup,CheckBox,CheckboxGroup,Divider,DatePicker,
//   Form,FormItem,Input,Menu,MebuGroup,MenuItem,Sider,SubMenu,Modal,Option,OptionGroup,Page,Panel,};

// import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import { Tree } from 'element-ui'


Vue.config.productionTip = false
// Vue.use(ViewUI);
Vue.use(ViewUI, {
  transfer: true,
  size: 'large',
  capture: false,
  select: {
      arrow: 'md-arrow-dropdown',
      arrowSize: 20
  },
  menu: {
    arrowSize: 25
  }
});
Vue.use(VueQuillEditor)

// Vue.use(ElementUI);
Vue.use(Tree)



Vue.directive('has', {
  inserted: function(el, binding) {
    if (!Vue.prototype.$_has(binding.value)) {
      el.parentNode.removeChild(el);
    }
  }
});


Vue.prototype.$_has = function(value){
  // console.log(value)
  // return false
  let isExists = false;
  let op_str = sessionStorage.getItem('operation_list')
  if (op_str == undefined || op_str == null){
    return false
  }
  let op_list = JSON.parse(op_str)
  if(op_list.indexOf(value) != -1){
    isExists = true
  }
  return isExists
}

Vue.prototype.$bus = new Vue({
  // beforeCreate: function () {
  //   console.log(this.$bus)
  // },
  router,
  render: h => h(App),
}).$mount('#app')



